<?php
class Test{
    private $abc = '';
    private $cba = '';


    public function __set($name, $value)
    {
        $this->$name = $value;
    }


    public function __get($name)
    {
       return $this->$name;
    }

}


$test = new Test();
$test->abc = 'abc';
var_dump($test->abc);























